<?php

use Dcat\Admin\Admin;
use Dcat\Admin\Grid;
use Dcat\Admin\Form;
use Dcat\Admin\Grid\Filter;
use Dcat\Admin\Show;

/**
 * Dcat-admin - admin builder based on Laravel.
 * @author jqh <https://github.com/jqhph>
 *
 * Bootstraper for Admin.
 *
 * Here you can remove builtin form field:
 *
 * extend custom field:
 * Dcat\Admin\Form::extend('php', PHPEditor::class);
 * Dcat\Admin\Grid\Column::extend('php', PHPEditor::class);
 * Dcat\Admin\Grid\Filter::extend('php', PHPEditor::class);
 *
 * Or require js and css assets:
 * Admin::css('/packages/prettydocs/css/styles.css');
 * Admin::js('/packages/prettydocs/js/main.js');
 *
 */
//系统模板自定义目录
app('view')->prependNamespace('admin', resource_path('views/laravel-admin'));

//Form\Field\Map::requireAssets();
//全局GRID组件设置
Grid::resolving(function(Grid $grid){
    $grid->toolsWithOutline(false);
    $grid->paginate(10);
    $grid->disableEditButton();
    $grid->showQuickEditButton();
    $grid->enableDialogCreate();
    $grid->disableBatchDelete();//禁止批量删除
    // 设置弹窗宽高，默认值为 '700px', '670px'
    $grid->setDialogFormDimensions('60%', '75%');

    $grid->actions(function (\Dcat\Admin\Grid\Displayers\Actions $action){
        //$action->disableDelete();
    });
});

//详情设置
Show::resolving(function (Show $show){
    $show->disableDeleteButton();//去掉删除按钮
});

//表单设置
Form::resolving(function (Form $form){
    $form->disableDeleteButton();//去掉删除按钮
});

//Form\Field\Map::requireAssets();
